package org.example.controller;

import cn.dev33.satoken.util.SaResult;
import io.swagger.annotations.Api;
import org.example.domain.dto.RegisterDto;
import org.example.service.domain.SysUserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/auth")
@Api(value = "LoginController", tags = {"登录、注册、退出"})
@Validated
public class AuthController {

    @Resource
    private SysUserService sysUserService;
    
    @PostMapping("/register")
    public SaResult register(@RequestBody @Validated RegisterDto registerDto) {
        sysUserService.register(registerDto);
        return SaResult.ok();
    }
    

}
